// I love Marauders forever
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+17,M=1e6+5;
int a[N];
int n;
bool bk[M];
int main(){
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	int T;
	cin>>T;
	for(int i=1;i<=T;i++){
		cin>>n;
		memset(bk,0,sizeof(bk));
		int ans=0;
		for(int i=1;i<=n;i++){
			cin>>a[i];
			if(bk[i]){
				bk[i]=0;
				ans+=a[i];
			}
			else bk[i]=1;
		}
		cout<<ans<<endl;
	}
	return 0;
}
